<template>
    <Table :columns="columns" :data="value">
        <template slot-scope="{ row, index }" slot="status">
            <span v-if="row.status === 0">待理货</span>
            <span v-if="row.status === 1">理货中</span>
            <span v-if="row.status === 2">理货完成</span>
        </template>
        <template slot-scope="{ row, index }" slot="product">
            {{row.product.code}}
        </template>
    </Table>
</template>

<script>
    export default {
        name: "tally",
        props: {
            value: {
                type: Array,
                default: () => []
            }
        },
        data(){
            return {
                columns: [{
                    title: '序号',
                    width: 80,
                    render: (h, {row, column, index}) => {
                        return h('div', index + 1);
                    }
                },{
                    title: '产品代码',
                    slot: 'product'
                },{
                    title: '理货单号',
                    key: 'code'
                },{
                    title: '预期数量',
                    key: 'quantity'
                },{
                    title: '收货数量',
                    key: 'send'
                },{
                    title: "状态",
                    slot: 'status'
                },{
                    title: '创建时间',
                    key: 'created_at'
                }]
            }
        }
    }
</script>

<style scoped>

</style>
